/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package JFreeChartExtensions.chartextensions.seriesproperties;

import JFreeChartExtensions.chartextensions.AbstractChartPanelExtension;
import JFreeChartExtensions.ExtendableChartPanel;
import JFreeChartExtensions.JChartMenu.ChartMenuListeners.SeriesPropertiesListener;
import JFreeChartExtensions.JChartMenu.JChartMenu;
import JFreeChartExtensions.containers.InternalFrameWithChart.InternalFrameWithChart;
import org.jfree.chart.ChartPanel;

/**
 *
 * @author Nobody
 */
public class SeriesPropertiesExtension extends AbstractChartPanelExtension {
   private JChartMenu seriesPropertiesMenuItem = new JChartMenu("Series properties...");
 
    public SeriesPropertiesExtension(ExtendableChartPanel panel) {
        super(panel);
        name="SeriesPropertiesExtension";
    }

    @Override
    public void applyExtension(ChartPanel chartPanel) {
       this.chartPanel = (ExtendableChartPanel) chartPanel;
        seriesPropertiesMenuItem.addListener(new SeriesPropertiesListener((ExtendableChartPanel) chartPanel));
        chartPanel.getPopupMenu().add(seriesPropertiesMenuItem);
    }

    @Override
    public void removeExtension() {
        chartPanel.getPopupMenu().remove(seriesPropertiesMenuItem);
    
    }



}
